#include "canJump.h"
bool canJump(vector<int>& num)
{

    int maxReach = num[0];
    for (int i = 1; i < num.size() && i <= maxReach; i++)
    {
        if (num[i] + i > maxReach)
            maxReach = num[i] + i;
    }
    return maxReach >= num.size() - 1;
}